#!/bin/bash
set -eu

TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework

setupenvironment

buildpackage 'simple-package'
buildpackage 'simple-package-new'

testpkgnotinstalled 'simple-package'
testpkgnotinstalled 'simple-package-new'

aptgetinstallpackage 'simple-package'
testpkginstalled 'simple-package'
testpkgnotinstalled 'simple-package-new'

generaterepository_and_switch_sources "$TMPWORKINGDIRECTORY/usr/src/RPM/RPMS"

testsuccess aptget update

testsuccess aptget dist-upgrade -y

testpkgnotinstalled 'simple-package'
testpkginstalled 'simple-package-new'
